#include<iostream>
#include<map>
#include<bits/stdc++.h>
using namespace std;

int main(){
	freopen("input.txt","r",stdin);
	string e,s;
	getline(cin,e);
	cin>>s;
	map<char,int> m;
	for(int i=0;i<e.length();i++){
		m[e[i]]++;
		if(e[i]>='A'&&e[i]<='Z')
		m[e[i]+32]++;
	}

	for(int i=0;i<s.length();i++){
		if(m[s[i]]==0){
			if(m['+']!=0&&s[i]>='A'&&s[i]<='Z'){

			}else{
				cout<<s[i];
			}

		}
		
	}
}